package com.wwdx.wechat.handler;

import com.wwdx.model.WwdxWeixinUserModel;
import com.wwdx.utils.ConstantHolder;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

import java.util.Map;

/**
 * @author liguoliang
 */
public abstract class AbstractUnsubscribeHandler extends AbstractHandler {

    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager)throws WxErrorException {
        String openId = wxMessage.getFromUser();
        this.logger.info("取消关注用户 OPENID: {}" ,openId);
        setOperations.remove(ConstantHolder.USER_CONCERN_TOTAL_COUNT,openId);
        return null;
    }
}